package com.be.beadmin.product.entity;

import com.be.beadmin.common.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * @Author Jiahao Liu
 * @CreateTime 2023-04-21
 * @Description 异常报告
 */
@Entity
@Table(name="T_OM_ErrorReport")
@Getter
@Setter
public class ErrorReport extends BaseEntity {

    @Column(name = "ProjectName",columnDefinition = "VARCHAR(255) COMMENT '项目名称' ")
    private String projectName;

    @Column(name = "WorkHour",columnDefinition = "float COMMENT '标准工时'")
    private Float workHour;

    // 异常附件
//    @Column(name = "AttachmentUrl",columnDefinition = "text COMMENT '异常附件链接'")
//    private String attachmentUrl;
//
//    @Column(name = "FileCode",columnDefinition = "VARCHAR(255) COMMENT '文件编码'")
//    private String fileCode;
//
//    @Column(name = "FileName",columnDefinition = "VARCHAR(255) COMMENT '文件名称'")
//    private String fileName;

    @Column(name = "BucketName",columnDefinition = "VARCHAR(255) COMMENT 'MinIO中的bucketName' ")
    private String bucketName;

    //
    @Column(name = "WorkOrderInforId",columnDefinition = "VARCHAR(50) COMMENT '工单id'")
    private String workOrderInforId;

    @Column(name = "Wo",columnDefinition = "VARCHAR(50) COMMENT '工单号'")
    private String wo;

    @Column(name = "TaskId",columnDefinition = "VARCHAR(50) COMMENT '生产工序id'")
    private String taskId;

    @Column(name = "ProductCode",columnDefinition = "VARCHAR(50) COMMENT '产品/柜体编号'")
    private String productCode;

    @Column(name = "ProcessSequence",columnDefinition = "VARCHAR(50) COMMENT '加工顺序号'")
    private String processSequence;

    @Column(name = "ProcessName",columnDefinition = "VARCHAR(50) COMMENT '加工工序名称'")
    private String processName;

    @Column(name = "ProcessCode",columnDefinition = "VARCHAR(50) COMMENT '加工工序编码'")
    private String processCode;

    @Column(name = "ErrorType",columnDefinition = "VARCHAR(50) COMMENT '异常分类'")
    private String errorType;

    @Column(name = "HandlingMan",columnDefinition = "VARCHAR(50) COMMENT '异常处理人'")
    private String handlingMan;

    @Column(name = "Priority",columnDefinition = "VARCHAR(50) COMMENT '优先级'")
    private String priority;

    @Column(name = "DeadLine",columnDefinition = "datetime COMMENT '要求处理时间'")
    private Date deadLine;

    @Column(name = "ErrorDes",columnDefinition = "text COMMENT '异常描述'")
    private String errorDes;

    @Column(name = "Operator",columnDefinition = "VARCHAR(50) COMMENT '异常申报人'")
    private String operator;

    @Column(name = "PushStatus",columnDefinition = "int COMMENT '异常推送状态'")
    private Integer pushStatus;

    @Column(name = "HandleStatus",columnDefinition = "int COMMENT '处理状态 0待处理 1已处理待完成 2已完成'")
    private Integer handleStatus;

    @Column(name = "HandleDes",columnDefinition = "text COMMENT '处理描述'")
    private String handleDes;


    @JsonFormat(
            pattern = "yyyy-MM-dd kk:mm:ss",
            timezone = "GMT+8"
    )
    @Column(name = "HandleTime",columnDefinition = "datetime COMMENT '处理时间'")
    private Date handleTime;

}
